home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Languguage OS 2
/
Languguage OS II Version 10-94 (Knowledge Media)(1994).ISO
/
language
/
pcpil
/
sample10.pil
< prev
next >
Wrap
Text File
|
1979-12-31
|
861b
|
45 lines
T:Program to store student scores.
:
:Each time you run this your name
:and a score is stored in the file
: K.REC
:
D:NAME$(30), REC$(35)
*NAME
T:Please enter your name.
A:$NAME$
J(%B=" "):NAME
T:Thank you.
W:15
*SCORE
TX:Pick a number between 1 and 100.
A:#SCORE
J(SCORE<1 ! SCORE>100):SCORE
T:
T:Thank you. We will pretend that
T:you have just taken a test and
T:that your score was #SCORE .
T:
W:30
R: Construct a 35-byte record. Name
R: is first 30 bytes, score in last 5 bytes.
C: REC$(1,30) = NAME$
C: REC$(31,5) = SCORE
R: Next statements save student name
R: and score in the KEEP file, K.REC
K: REC$
T:Your score has been recorded in the
:student records file. You can list
:this file by the command
:
: TYPE K.REC
:
:Notice that the last entry in the
:file contains your name and score.